package com.yuni.index.Repository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Repository;

import com.yuni.index.Model.User;

@Repository
public class UserRepository {

    @Autowired
    private JdbcTemplate jdbcTemplate;

    public boolean saveUser(User user) {
        String sql = "INSERT INTO user (userName, email, password) VALUES (?, ?, ?)";
        int rows = jdbcTemplate.update(sql, user.getUserName(), user.getEmail(), user.getPassword());
        return rows > 0;
    }
}
